From a2ce6268b2f5380a695f2cada25fe73cfb061b4a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 19 Nov 2020 07:30:30 -0500 Subject: [PATCH] gtk-demo: Make a more interesting constraints demo Show various ways to influence spacing. This is more or less modeled on the way Androids constraint layout lets you set up 'chains'. --- demos/gtk-demo/constraints_builder.c | 8 +- demos/gtk-demo/constraints_builder.ui | 446 +++++++++++++++++++++++--- 2 files changed, 405 insertions(+), 49 deletions(-) diff --git a/demos/gtk-demo/constraints_builder.c b/demos/gtk-demo/constraints_builder.c index 1233adaed1..5d8b6a9413 100644 --- a/demos/gtk-demo/constraints_builder.c +++ b/demos/gtk-demo/constraints_builder.c @@ -1,8 +1,10 @@ /* Constraints/Builder * - * GtkConstraintLayouts can be created in .ui files, and constraints can be - * set up at that time as well, as this example demonstrates. It uses the - * same setup as the “Simple” constraints demo. + * GtkConstraintLayouts can be created in .ui files, and constraints can + * be set up at that time as well, as this example demonstrates. It shows + * various ways to do spacing and sizing with constraints. + * + * Make the window wider to see the rows react differently */ #include diff --git a/demos/gtk-demo/constraints_builder.ui b/demos/gtk-demo/constraints_builder.ui index 1766f931c7..c5748e7f42 100644 --- a/demos/gtk-demo/constraints_builder.ui +++ b/demos/gtk-demo/constraints_builder.ui @@ -5,99 +5,453 @@ 260 + fill + fill + 10 + 10 + 10 + 10 - - + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Child 1 + A - Child 2 + B - Child 3 + C + + + + + A + + + + + B + + + + + C + + + + + A + + + + + B + + + + + C + + + + + A + + + + + B + + + + + C + + + + + A + + + + + B + + + + + C -- 2.30.2